#include "MarkerTracker.h"

namespace TUMAR { namespace MarkerTracking {
	MarkerTracker::MarkerTracker(void) :
		memory(),
		markerContainer(),
		buffer(),
		greyProcessor(),
		thresholdProcessor(),
		markerProcessor(&memory, &markerContainer)
	{
		this->processors.add(&this->greyProcessor);
		this->processors.add(&this->thresholdProcessor);
		this->processors.add(&this->markerProcessor);
	}

	MarkerTracker::~MarkerTracker(void)
	{
	}

	void MarkerTracker::OnImageCaptured(const cv::Mat& image)
	{
		this->memory.Clear();
		this->markerContainer.clear();

		this->processors.process(image, buffer);

		this->MarkersFound(this->markerContainer);
	}
}}